// import echarts from "echarts";
// import * as echarts from "echarts/core";
// 按需引入方式
import echarts from "@/views/package/echarts/components/BaseEcharts/utils/echarts";
import { getLegend } from "./common/legend";
import { getDataZoom } from "./common/dataZoom";
export function getOptions() {
  const title = "Stacked Line";
  const xData = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
  const series = [
    {
      name: "Email",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [120, 132, null, 134, 90, 230, 210],
    },
    {
      name: "Union Ads",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [220, 182, 191, null, 290, 330, 310],
    },
    {
      name: "Video Ad222222222222222222dsadasdadsad2222222s",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [150, 232, 201, 154, 190, 330, 410],
    },
    {
      name: "Direct",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [320, null, 301, 334, 390, 330, 320],
    },
    {
      name: "Search3232 Engine",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [820, 932, 901, 934, 1290, 1330, 1320],
    },
    {
      name: "Search 321Engine",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [820, 932, 901, 934, null, 1330, 1320],
    },
    {
      name: "Search3213 Engine",
      type: "line",
      stack: "Total",
      symbol: "none",
      data: [820, 932, 901, null, 1290, 1330, 1320],
    },
  ];
  const option = {
    title: {
      text: title,
    },
    tooltip: {
      trigger: "axis",
    },
    legend: getLegend(),
    grid: {
      left: "3%",
      right: "320",
      bottom: "50",
      containLabel: true,
    },
    toolbox: {
      show: true,
      right: 320,
      top: 30,
      feature: {
        dataZoom: {
          show: true,
          // title: { back: "缩放还原" },
        },
        // restore: {},
        // myBig: {},
        // saveAsImage: { show: false },
      },
    },
    xAxis: {
      type: "category",
      boundaryGap: false,
      data: xData,
      // splitLine: {
      //   show: false,
      // },
      // axisLabel: {
      //   color: "#999",
      //   fontSize: 12,
      // },
      connectNulls: false,
      name: "",
    },
    yAxis: {
      type: "value",
      axisLine: {
        show: true,
      },
      // splitLine: {
      //   show: false,
      // },
      name: "",
    },
    series,
    dataZoom: getDataZoom(),
  };
  return option;
}
